/*
 * $RCSfile: Processor_44_Enter.java,v $
 * $Revision: 1.1  $
 * $Date: 2012-8-16  $
 *
 * Copyright (C) 2005 Bettem, Inc. All rights reserved.
 *
 * This software is the proprietary information of Bettem, Inc.
 * Use is subject to license terms.
 */
package com.i366.processor;

import org.apache.log4j.Logger;

import com.i366.service.RoomService;
import com.work.comm.util.I366PickUtil;
import com.work.db.model.UserInfo;
import com.work.engine.protocal.request.Request;
import com.work.engine.server.handler.Handler;

/**
 * 心跳包处理
 * <p>Title: EnterProcessor</p> 
 * <p>Description: </p> 
 * <p>Copyright: Copyright (c) 2006</p> 
 * @author shenxing.ruan
 * @version 1.0
 */
public class Processor_97_Xintiao extends Handler {
	private Logger logger = Logger.getLogger(Processor_97_Xintiao.class);
	public byte[] handleRequest() {
		logger.debug("EnterProcessor userId is : " + this.getGameRequest().getUserId());
		//=======================相关验证=================
		Request request = getGameRequest();
		UserInfo userInfo = RoomService.updateUser(request);
		if (userInfo == null) {
			return I366PickUtil.packAll(new Object[][]{
					{60,1,I366PickUtil.TYPE_INT_1}
			}, 97);
		}
		return I366PickUtil.packAll(new Object[][]{
				{60,0,I366PickUtil.TYPE_INT_1}
		}, 97);
	}
	public Object makeObject() throws Exception {
		return new Processor_97_Xintiao();
	}

}

